<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta name="layout" content="main">
    <title>Register New Facility</title>
  </head>
  
  <body>
    <h1>Register New Facility</h1>
    <a>* = required field</a>
    
   <g:hasErrors>
    <div class="errors">
      <g:renderErrors bean="${facility}" as="list" />
    </div>
   </g:hasErrors>
  
  <g:form action="register">
    <dl>
      <dt>Facility Name*:  </dt>
      <dd><g:textField name="name" value="${facility?.name}"/></dd>
      <dt>Latitude*: </dt>
      <dd><g:textField name="latitude" value="${facility?.latitude}"/></dd>
      <dt>Longitude*:  </dt>
      <dd><g:textField name="longitude" value="${facility?.longitude}"/></dd>
      <dt>Facility Type*:  </dt>
      <dd><g:select name="facilityType" id="facilityType" from="${['Hospital','Emergency', 'Clinic', 'Family']}"
                value="${facility?.facilityType}"></g:select></dd>
      <dt>Address 1*:  </dt>
      <dd><g:textField name="primaryAddress.address" value="${facility?.primaryAddress?.address}" /></dd>
      <dt>Address 2:  </dt>
      <dd><g:textField name="primaryAddress.address2" value="${facility?.primaryAddress?.address2}" /></dd>
      <dt>LGA*:  </dt>
      <dd><g:textField name="primaryAddress.lga" value="${facility?.primaryAddress?.lga}" /></dd>
      <dt>State*:  </dt>
      <dd><g:textField name="primaryAddress.state" value="${facility?.primaryAddress?.state}" /></dd>
      <dt>Phone Number: </dt>
      <dd><g:textField name="number" value="${telephoneNumber?.number}" />
            <g:select name="phoneType" id="phoneType" from="${['Fax', 'Home', 'Work', 'Cell']}"
                      value="${telephoneNumber?.phoneType}"></g:select></dd>
      <dt>Graphic Location:  </dt>
      <dd><g:textArea name="facilitySite.graphicLocation" value="${facility?.facilitySite?.graphicLocation}" width="1000px" height="1000px"/></dd>
      <dt>Mission Statement:  </dt>
      <dd><g:textArea name="facilitySite.missionStatement" value="${facility?.facilitySite?.missionStatement}" width="1000px" height="1000px"/></dd>
      <dt>Summary:  </dt>
      <dd><g:textArea name="facilitySite.detail" value="${facility?.facilitySite?.detail}" width="1000px" height="1000px" /></dd>
      <dt>In Operation:  <g:checkBox name="isInOperation" value="${isInOperation}" checked="true"/><dt>
    </dl>
    <br><g:submitButton name="register" value="Register"/></br>
  </g:form>
  
  </body>
</html>
